import Router from 'vue-router'
import {mixin} from '@/utils'
import _404 from '@/view/404'
import index from '@/view/index'
import account from './account/account-module'

const router = new Router({
  routes: [
    {
      path: '/',
      name: '首页',
      component: mixin(index)
    },
    {
      path: '*',
      name: '404',
      component: _404
    },
    {
      path: '/login',
      name: '登录',
      component: () => import('@/view/login/login'),
      hidden: true
    },
    {
      path: '/account',
      name: '账号管理',
      component: {template: '<router-view />'},
      children: account
    },
  ]
})

router.beforeEach((to, from, next) => {
  next()
})

export default router
